package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Letter;
import cn.wolfcode.trip.base.query.LetterQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;


public interface LetterMapper {

    int insert(@Param("sendId")Long sendId, @Param("acceptId") Long acceptId, @Param("content") String content,@Param("createTime") Date createTime);

    Letter selectByPrimaryKey(Long id);

    List<Letter> selectAll();

    int updateByPrimaryKey(Letter record);


    List<Map> query(LetterQueryObject qo);
    List<Letter> query1(LetterQueryObject qo);
    Integer countUnReadSystemMessages(LetterQueryObject qo);

    void updateState(@Param("sendId") Long sendId, @Param("acceptId") Long acceptId,@Param("state") Integer state);

    List<Map> queryBySendIdOrAcceptId(@Param("sendId")Long sendId,@Param("acceptId") Long acceptId);

    List<Map> getLetterUnread(@Param("sendId")Long sendId,@Param("acceptId") Long acceptId);

}
